package com.fg.pro.trade.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 商品分类(TradeCategory)表实体类
 *
 * @author makejava
 * @since 2025-08-11 14:47:29
 */
@SuppressWarnings("serial")
@Data
public class TradeCategory extends Model<TradeCategory> {
//主键
    private Long id;

    private Date createTime;

    private Date updateTime;
//公司id
    private Long categoryGroupId;
//一级分类的parent_id 是 0
    private Long categoryParentId;
//分类树名称
    private String categoryName;
//等级
    private Integer categoryLev;
//排序
    private Integer categorySort;
//浮动比例
    private Double categoryDiscount;

    @TableField(exist = false)
    private List<TradeCategory> children;

    /**
     * 获取主键值
     *
     * @return 主键值
     */
    @Override
    public Serializable pkVal() {
        return this.id;
    }
}

